home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / N-P / NShell Prog.sit / nShell Prog / Tech Notes / TN 2 - Think Pascal < prev    next >
MacBinary  |  1994-08-28  |  7.3 KB  |  [TEXT/ttxt]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Sun Aug 28 18:40:05 1994, modified Sun Aug 28 18:40:05 1994, creator SimpleText, type ASCII, 6912 bytes "TN 2 - Think Pascal" , at 0x1b80 332 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ttxt]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 13 54 4e 20 32 20 2d | 20 54 68 69 6e 6b 20 50 |..TN 2 -| Think P|
|00000010| 61 73 63 61 6c 00 00 00 | 00 00 00 00 00 00 00 00 |ascal...|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 74 74 78 | 74 00 00 00 00 00 00 00 |.TEXTttx|t.......|
|00000050| 00 00 00 00 00 1b 00 00 | 00 01 4c aa 86 c2 c5 aa |........|..L.....|
|00000060| 86 c2 c5 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 94 67 00 00 |........|.....g..|
|00000080| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000090| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000000c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0d 0d 4e 75 6d |========|===..Num|
|000000d0| 62 65 72 20 32 20 2d 20 | 42 75 69 6c 64 69 6e 67 |ber 2 - |Building|
|000000e0| 20 43 6f 6d 6d 61 6e 64 | 73 20 55 73 69 6e 67 20 | Command|s Using |
|000000f0| 54 68 69 6e 6b 20 50 61 | 73 63 61 6c 0d 0d 52 65 |Think Pa|scal..Re|
|00000100| 76 69 73 69 6f 6e 73 3a | 09 41 75 67 2e 20 32 38 |visions:|.Aug. 28|
|00000110| 2c 20 31 39 39 34 0d 0d | 6e 53 68 65 6c 6c 28 74 |, 1994..|nShell(t|
|00000120| 6d 29 20 54 65 63 68 6e | 69 63 61 6c 20 4e 6f 74 |m) Techn|ical Not|
|00000130| 65 0d 0d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |e..=====|========|
|00000140| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000150| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000160| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000170| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 0d |========|======..|
|00000180| 45 61 72 6c 79 20 72 65 | 6c 65 61 73 65 73 20 6f |Early re|leases o|
|00000190| 66 20 74 68 65 20 6e 53 | 68 65 6c 6c 20 63 6f 6e |f the nS|hell con|
|000001a0| 74 61 69 6e 65 64 20 73 | 61 6d 70 6c 65 20 63 6f |tained s|ample co|
|000001b0| 64 65 20 66 6f 72 20 74 | 68 65 20 54 68 69 6e 6b |de for t|he Think|
|000001c0| 20 43 20 64 65 76 65 6c | 6f 70 6d 65 6e 74 20 65 | C devel|opment e|
|000001d0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 2e 20 20 54 68 69 |nvironme|nt. Thi|
|000001e0| 73 20 4e 6f 74 65 20 64 | 65 73 63 72 69 62 65 73 |s Note d|escribes|
|000001f0| 20 68 6f 77 20 74 6f 20 | 62 75 69 6c 64 20 6e 53 | how to |build nS|
|00000200| 68 65 6c 6c 20 63 6f 6d | 6d 61 6e 64 73 20 75 73 |hell com|mands us|
|00000210| 69 6e 67 20 54 68 69 6e | 6b 20 50 61 73 63 61 6c |ing Thin|k Pascal|
|00000220| 2e 0d 0d 45 78 61 6d 70 | 6c 65 73 0d 3d 3d 3d 3d |...Examp|les.====|
|00000230| 3d 3d 3d 3d 0d 0d 45 78 | 61 6d 70 6c 65 20 70 72 |====..Ex|ample pr|
|00000240| 6f 6a 65 63 74 73 20 68 | 61 76 65 20 62 65 65 6e |ojects h|ave been|
|00000250| 20 72 65 6c 65 61 73 65 | 64 20 69 6e 20 61 20 70 | release|d in a p|
|00000260| 61 63 6b 61 67 65 20 63 | 61 6c 6c 65 64 20 22 6e |ackage c|alled "n|
|00000270| 53 68 65 6c 6c 28 74 6d | 29 20 54 68 69 6e 6b 20 |Shell(tm|) Think |
|00000280| 50 61 73 63 61 6c 20 45 | 78 61 6d 70 6c 65 73 22 |Pascal E|xamples"|
|00000290| 2e 20 20 54 68 69 73 20 | 70 61 63 6b 61 67 65 20 |. This |package |
|000002a0| 63 6f 6e 74 61 69 6e 73 | 20 65 78 61 6d 70 6c 65 |contains| example|
|000002b0| 20 70 72 6f 6a 65 63 74 | 73 20 69 6e 20 54 68 69 | project|s in Thi|
|000002c0| 6e 6b 20 50 61 73 63 61 | 6c 2c 20 61 73 20 77 65 |nk Pasca|l, as we|
|000002d0| 6c 6c 20 61 73 20 43 20 | 73 6f 75 72 63 65 20 63 |ll as C |source c|
|000002e0| 6f 64 65 20 66 6f 72 20 | 74 68 65 20 6e 65 77 20 |ode for |the new |
|000002f0| 22 6e 53 68 65 6c 6c 2e | 6c 69 62 22 2e 0d 0d 54 |"nShell.|lib"...T|
|00000300| 68 65 20 49 6e 74 65 72 | 66 61 63 65 0d 3d 3d 3d |he Inter|face.===|
|00000310| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 0d 54 68 65 20 |========|==..The |
|00000320| 67 65 6e 65 72 61 6c 20 | 69 6e 74 65 72 66 61 63 |general |interfac|
|00000330| 65 20 66 6f 72 20 6e 53 | 68 65 6c 6c 20 63 6f 6d |e for nS|hell com|
|00000340| 6d 61 6e 64 73 20 69 73 | 20 64 65 73 63 72 69 62 |mands is| describ|
|00000350| 65 64 20 69 6e 20 74 68 | 65 20 22 50 72 6f 67 72 |ed in th|e "Progr|
|00000360| 61 6d 6d 65 72 27 73 20 | 47 75 69 64 65 20 74 6f |ammer's |Guide to|
|00000370| 20 74 68 65 20 6e 53 68 | 65 6c 6c 22 2e 20 20 46 | the nSh|ell". F|
|00000380| 6f 72 20 74 68 69 73 20 | 50 61 73 63 61 6c 20 69 |or this |Pascal i|
|00000390| 6e 74 65 72 66 61 63 65 | 2c 20 61 20 6e 65 77 20 |nterface|, a new |
|000003a0| 6c 69 62 72 61 72 79 20 | 28 6e 53 68 65 6c 6c 2e |library |(nShell.|
|000003b0| 6c 69 62 29 20 77 61 73 | 20 77 72 69 74 74 65 6e |lib) was| written|
|000003c0| 20 74 6f 20 74 72 61 6e | 73 6c 61 74 65 20 6e 53 | to tran|slate nS|
|000003d0| 68 65 6c 6c 20 76 61 72 | 69 61 62 6c 65 73 20 61 |hell var|iables a|
|000003e0| 6e 64 20 66 75 6e 63 74 | 69 6f 6e 73 20 66 72 6f |nd funct|ions fro|
|000003f0| 6d 20 43 20 69 6e 74 6f | 20 50 61 73 63 61 6c 2e |m C into| Pascal.|
|00000400| 20 20 54 68 65 20 64 69 | 66 66 65 72 65 6e 63 65 | The di|fference|
|00000410| 73 20 62 65 74 77 65 65 | 6e 20 74 68 65 20 50 61 |s betwee|n the Pa|
|00000420| 73 63 61 6c 20 69 6e 74 | 65 72 66 61 63 65 20 61 |scal int|erface a|
|00000430| 6e 64 20 74 68 65 20 67 | 65 6e 65 72 61 6c 20 6f |nd the g|eneral o|
|00000440| 6e 65 20 61 72 65 20 64 | 69 73 63 75 73 73 65 64 |ne are d|iscussed|
|00000450| 20 62 65 6c 6f 77 3a 0d | 0d 41 20 4e 65 77 20 4d | below:.|.A New M|
|00000460| 61 69 6e 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 0d |ain.----|------..|
|00000470| 54 68 65 20 6e 53 68 65 | 6c 6c 2e 6c 69 62 20 6e |The nShe|ll.lib n|
|00000480| 6f 77 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |ow conta|ins the |
|00000490| 74 72 75 65 20 22 6d 61 | 69 6e 22 20 6f 66 20 74 |true "ma|in" of t|
|000004a0| 68 65 20 6e 53 68 65 6c | 6c 20 63 6f 6d 6d 61 6e |he nShel|l comman|
|000004b0| 64 2e 20 20 54 68 69 73 | 20 6d 61 69 6e 20 72 6f |d. This| main ro|
|000004c0| 75 74 69 6e 65 20 73 65 | 74 73 20 75 70 20 74 68 |utine se|ts up th|
|000004d0| 65 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 61 6e |e enviro|nment an|
|000004e0| 64 20 63 61 6c 6c 73 20 | 61 20 50 61 73 63 61 6c |d calls |a Pascal|
|000004f0| 20 72 6f 75 74 69 6e 65 | 3a 0d 0d 20 20 70 72 6f | routine|:.. pro|
|00000500| 63 65 64 75 72 65 20 74 | 68 65 43 6f 6d 6d 61 6e |cedure t|heComman|
|00000510| 64 20 28 6e 73 68 63 5f | 70 61 72 6d 73 3a 20 74 |d (nshc_|parms: t|
|00000520| 5f 6e 73 68 63 5f 70 61 | 72 6d 73 3b 20 6e 73 68 |_nshc_pa|rms; nsh|
|00000530| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|00000540| 63 61 6c 6c 73 29 3b 0d | 0d 54 68 69 73 20 6e 65 |calls);.|.This ne|
|00000550| 77 20 70 72 6f 63 65 64 | 75 72 65 20 69 73 20 74 |w proced|ure is t|
|00000560| 68 65 20 6e 65 77 20 22 | 6d 61 69 6e 22 20 66 6f |he new "|main" fo|
|00000570| 72 20 50 61 73 63 61 6c | 20 63 6f 6d 6d 61 6e 64 |r Pascal| command|
|00000580| 73 2e 20 20 54 68 69 73 | 20 72 6f 75 74 69 6e 65 |s. This| routine|
|00000590| 20 69 73 20 72 65 73 70 | 6f 6e 73 69 62 6c 65 20 | is resp|onsible |
|000005a0| 66 6f 72 20 6d 61 6e 61 | 67 69 6e 67 20 74 68 65 |for mana|ging the|
|000005b0| 20 6e 73 68 63 5f 70 61 | 72 6d 73 20 22 61 63 74 | nshc_pa|rms "act|
|000005c0| 69 6f 6e 22 20 61 6e 64 | 20 22 72 65 73 75 6c 74 |ion" and| "result|
|000005d0| 22 20 76 61 72 69 61 62 | 6c 65 73 2c 20 61 73 20 |" variab|les, as |
|000005e0| 77 65 6c 6c 20 61 73 20 | 70 65 72 66 6f 72 6d 69 |well as |performi|
|000005f0| 6e 67 20 61 6e 79 20 63 | 6f 6d 6d 61 6e 64 2d 73 |ng any c|ommand-s|
|00000600| 70 65 63 69 66 69 63 20 | 74 61 73 6b 73 2e 0d 0d |pecific |tasks...|
|00000610| 41 20 4e 65 77 20 6e 73 | 68 63 5f 70 61 72 6d 73 |A New ns|hc_parms|
|00000620| 0d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.-------|--------|
|00000630| 2d 0d 0d 54 68 65 20 64 | 61 74 61 20 69 6e 74 65 |-..The d|ata inte|
|00000640| 72 66 61 63 65 20 66 6f | 72 20 63 6f 6d 6d 61 6e |rface fo|r comman|
|00000650| 64 73 20 68 61 73 20 62 | 65 65 6e 20 74 72 61 6e |ds has b|een tran|
|00000660| 73 6c 61 74 65 64 20 69 | 6e 74 6f 20 50 61 73 63 |slated i|nto Pasc|
|00000670| 61 6c 2c 20 61 6e 64 20 | 69 73 20 64 65 66 69 6e |al, and |is defin|
|00000680| 65 64 20 69 6e 20 74 68 | 65 20 66 69 6c 65 20 22 |ed in th|e file "|
|00000690| 6e 73 68 63 2e 70 22 2e | 20 20 56 61 72 69 61 62 |nshc.p".| Variab|
|000006a0| 6c 65 73 20 77 69 74 68 | 69 6e 20 74 68 69 73 20 |les with|in this |
|000006b0| 73 74 72 75 63 74 75 72 | 65 20 66 6f 6c 6c 6f 77 |structur|e follow|
|000006c0| 20 74 68 65 20 72 6f 6c | 65 73 20 73 65 74 20 6f | the rol|es set o|
|000006d0| 75 74 20 69 6e 20 74 68 | 65 20 50 72 6f 67 72 61 |ut in th|e Progra|
|000006e0| 6d 6d 65 72 27 73 20 47 | 75 69 64 65 2e 0d 0d 41 |mmer's G|uide...A|
|000006f0| 20 4e 65 77 20 6e 73 68 | 63 5f 63 61 6c 6c 73 0d | New nsh|c_calls.|
|00000700| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000710| 0d 0d 41 20 6e 65 77 20 | 63 61 6c 6c 62 61 63 6b |..A new |callback|
|00000720| 20 69 6e 74 65 72 66 61 | 63 65 20 68 61 73 20 62 | interfa|ce has b|
|00000730| 65 65 6e 20 77 72 69 74 | 74 65 6e 20 66 6f 72 20 |een writ|ten for |
|00000740| 50 61 73 63 61 6c 20 63 | 6f 6d 6d 61 6e 64 73 2e |Pascal c|ommands.|
|00000750| 20 20 43 61 6c 6c 73 20 | 61 72 65 20 6e 6f 77 20 | Calls |are now |
|00000760| 6d 61 64 65 20 74 68 72 | 6f 75 67 68 20 74 68 65 |made thr|ough the|
|00000770| 20 22 6e 53 68 65 6c 6c | 2e 6c 69 62 22 2e 20 20 | "nShell|.lib". |
|00000780| 44 65 66 69 6e 69 74 69 | 6f 6e 73 20 66 6f 72 20 |Definiti|ons for |
|00000790| 74 68 65 73 65 20 72 6f | 75 74 69 6e 65 73 20 61 |these ro|utines a|
|000007a0| 72 65 20 66 6f 75 6e 64 | 20 69 6e 20 74 68 65 20 |re found| in the |
|000007b0| 66 69 6c 65 20 22 6e 73 | 68 63 2e 70 22 2e 20 20 |file "ns|hc.p". |
|000007c0| 54 68 65 20 6e 73 68 63 | 5f 63 61 6c 6c 73 20 70 |The nshc|_calls p|
|000007d0| 6f 69 6e 74 65 72 20 6d | 61 79 20 6e 6f 74 20 62 |ointer m|ay not b|
|000007e0| 65 20 75 73 65 64 20 64 | 69 72 65 63 74 6c 79 2c |e used d|irectly,|
|000007f0| 20 62 75 74 20 69 73 20 | 70 61 73 73 65 64 20 69 | but is |passed i|
|00000800| 6e 20 65 61 63 68 20 63 | 61 6c 6c 20 74 6f 20 74 |n each c|all to t|
|00000810| 68 65 20 6c 69 62 72 61 | 72 79 2e 0d 0d 45 61 63 |he libra|ry...Eac|
|00000820| 68 20 63 61 6c 6c 20 72 | 65 71 75 69 72 65 73 20 |h call r|equires |
|00000830| 74 68 61 74 20 74 68 65 | 20 6e 73 68 63 5f 63 61 |that the| nshc_ca|
|00000840| 6c 6c 73 20 70 6f 69 6e | 74 65 72 20 62 65 20 70 |lls poin|ter be p|
|00000850| 61 73 73 65 64 20 61 73 | 20 74 68 65 20 66 69 72 |assed as| the fir|
|00000860| 73 74 20 70 61 72 61 6d | 65 74 65 72 2e 20 20 54 |st param|eter. T|
|00000870| 6f 20 65 61 73 65 20 74 | 79 70 69 6e 67 2c 20 61 |o ease t|yping, a|
|00000880| 20 73 68 6f 72 74 65 72 | 20 6e 61 6d 65 20 63 6f | shorter| name co|
|00000890| 75 6c 64 20 62 65 20 75 | 73 65 64 20 66 6f 72 20 |uld be u|sed for |
|000008a0| 74 68 65 20 63 61 6c 6c | 20 70 6f 69 6e 74 65 72 |the call| pointer|
|000008b0| 2c 20 6f 72 20 6d 61 63 | 72 6f 73 20 63 6f 75 6c |, or mac|ros coul|
|000008c0| 64 20 62 65 20 64 65 66 | 69 6e 65 64 20 74 6f 20 |d be def|ined to |
|000008d0| 65 6c 69 6d 69 6e 61 74 | 65 20 69 74 20 65 6e 74 |eliminat|e it ent|
|000008e0| 69 72 65 6c 79 2e 0d 0d | 6f 75 74 70 75 74 20 74 |irely...|output t|
|000008f0| 6f 20 73 74 64 65 72 72 | 0d 3d 3d 3d 3d 3d 3d 3d |o stderr|.=======|
|00000900| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0d 0d 4e 53 48 5f 70 |========|=..NSH_p|
|00000910| 75 74 63 68 61 72 5f 65 | 72 72 0d 2d 2d 2d 2d 2d |utchar_e|rr.-----|
|00000920| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 0d 70 72 6f 63 |--------|--..proc|
|00000930| 65 64 75 72 65 20 4e 53 | 48 5f 70 75 74 63 68 61 |edure NS|H_putcha|
|00000940| 72 5f 65 72 72 20 28 6e | 73 68 63 5f 63 61 6c 6c |r_err (n|shc_call|
|00000950| 73 3a 20 74 5f 6e 73 68 | 63 5f 63 61 6c 6c 73 3b |s: t_nsh|c_calls;|
|00000960| 20 63 3a 20 63 68 61 72 | 29 3b 0d 0d 54 68 69 73 | c: char|);..This|
|00000970| 20 72 6f 75 74 69 6e 65 | 20 70 72 69 6e 74 73 20 | routine| prints |
|00000980| 61 20 73 69 6e 67 6c 65 | 20 63 68 61 72 61 63 74 |a single| charact|
|00000990| 65 72 20 74 6f 20 74 68 | 65 20 73 74 64 65 72 72 |er to th|e stderr|
|000009a0| 20 64 65 76 69 63 65 2e | 0d 0d 4e 53 48 5f 70 75 | device.|..NSH_pu|
|000009b0| 74 73 5f 65 72 72 0d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ts_err.-|--------|
|000009c0| 2d 2d 2d 0d 0d 70 72 6f | 63 65 64 75 72 65 20 4e |---..pro|cedure N|
|000009d0| 53 48 5f 70 75 74 73 5f | 65 72 72 20 28 6e 73 68 |SH_puts_|err (nsh|
|000009e0| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|000009f0| 63 61 6c 6c 73 3b 20 63 | 5f 73 74 72 69 6e 67 3a |calls; c|_string:|
|00000a00| 20 70 74 72 29 3b 0d 0d | 54 68 69 73 20 72 6f 75 | ptr);..|This rou|
|00000a10| 74 69 6e 65 20 70 72 69 | 6e 74 73 20 61 20 63 2d |tine pri|nts a c-|
|00000a20| 73 74 79 6c 65 2c 20 6e | 75 6c 6c 2d 74 65 72 6d |style, n|ull-term|
|00000a30| 69 6e 61 74 65 64 2c 20 | 73 74 72 69 6e 67 20 74 |inated, |string t|
|00000a40| 6f 20 73 74 64 65 72 72 | 2e 20 20 54 68 65 20 73 |o stderr|. The s|
|00000a50| 74 72 69 6e 67 20 62 75 | 66 66 65 72 20 73 68 6f |tring bu|ffer sho|
|00000a60| 75 6c 64 20 62 65 20 64 | 65 66 69 6e 65 64 20 61 |uld be d|efined a|
|00000a70| 73 3a 20 22 66 6f 6f 20 | 3a 20 70 61 63 6b 65 64 |s: "foo |: packed|
|00000a80| 20 61 72 72 61 79 5b 78 | 2e 2e 79 5d 20 6f 66 20 | array[x|..y] of |
|00000a90| 63 68 61 72 22 2e 20 20 | 54 68 65 20 63 61 6c 6c |char". |The call|
|00000aa0| 20 6d 61 79 20 74 68 65 | 6e 20 62 65 20 6d 61 64 | may the|n be mad|
|00000ab0| 65 20 75 73 69 6e 67 20 | 74 68 65 20 40 20 6f 70 |e using |the @ op|
|00000ac0| 65 72 61 74 6f 72 3a 20 | 22 4e 53 48 5f 70 75 74 |erator: |"NSH_put|
|00000ad0| 73 5f 65 72 72 28 20 6e | 73 68 63 5f 63 61 6c 6c |s_err( n|shc_call|
|00000ae0| 73 2c 20 40 66 6f 6f 20 | 29 3b 0d 0d 4e 53 48 5f |s, @foo |);..NSH_|
|00000af0| 70 75 74 53 74 72 5f 65 | 72 72 0d 2d 2d 2d 2d 2d |putStr_e|rr.-----|
|00000b00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 0d 70 72 6f 63 65 |--------|-..proce|
|00000b10| 64 75 72 65 20 4e 53 48 | 5f 70 75 74 53 74 72 5f |dure NSH|_putStr_|
|00000b20| 65 72 72 20 28 6e 73 68 | 63 5f 63 61 6c 6c 73 3a |err (nsh|c_calls:|
|00000b30| 20 74 5f 6e 73 68 63 5f | 63 61 6c 6c 73 3b 20 73 | t_nshc_|calls; s|
|00000b40| 3a 20 53 74 72 32 35 35 | 29 3b 0d 0d 54 68 69 73 |: Str255|);..This|
|00000b50| 20 72 6f 75 74 69 6e 65 | 20 70 72 69 6e 74 73 20 | routine| prints |
|00000b60| 61 20 50 61 73 63 61 6c | 20 73 74 72 69 6e 67 20 |a Pascal| string |
|00000b70| 74 6f 20 74 68 65 20 73 | 74 64 65 72 72 20 64 65 |to the s|tderr de|
|00000b80| 76 69 63 65 2e 0d 0d 6f | 75 74 70 75 74 20 74 6f |vice...o|utput to|
|00000b90| 20 73 74 64 6f 75 74 0d | 3d 3d 3d 3d 3d 3d 3d 3d | stdout.|========|
|00000ba0| 3d 3d 3d 3d 3d 3d 3d 3d | 0d 0d 4e 53 48 5f 70 75 |========|..NSH_pu|
|00000bb0| 74 63 68 61 72 0d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |tchar.--|--------|
|00000bc0| 2d 0d 0d 70 72 6f 63 65 | 64 75 72 65 20 4e 53 48 |-..proce|dure NSH|
|00000bd0| 5f 70 75 74 63 68 61 72 | 20 28 6e 73 68 63 5f 63 |_putchar| (nshc_c|
|00000be0| 61 6c 6c 73 3a 20 74 5f | 6e 73 68 63 5f 63 61 6c |alls: t_|nshc_cal|
|00000bf0| 6c 73 3b 20 63 3a 20 63 | 68 61 72 29 3b 0d 20 0d |ls; c: c|har);. .|
|00000c00| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 70 72 69 |This rou|tine pri|
|00000c10| 6e 74 73 20 61 20 73 69 | 6e 67 6c 65 20 63 68 61 |nts a si|ngle cha|
|00000c20| 72 61 63 74 65 72 20 74 | 6f 20 74 68 65 20 73 74 |racter t|o the st|
|00000c30| 64 6f 75 74 20 64 65 76 | 69 63 65 2e 0d 0d 4e 53 |dout dev|ice...NS|
|00000c40| 48 5f 70 75 74 73 0d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |H_puts.-|-------.|
|00000c50| 0d 70 72 6f 63 65 64 75 | 72 65 20 4e 53 48 5f 70 |.procedu|re NSH_p|
|00000c60| 75 74 73 20 28 6e 73 68 | 63 5f 63 61 6c 6c 73 3a |uts (nsh|c_calls:|
|00000c70| 20 74 5f 6e 73 68 63 5f | 63 61 6c 6c 73 3b 20 63 | t_nshc_|calls; c|
|00000c80| 5f 73 74 72 69 6e 67 3a | 20 70 74 72 29 3b 0d 0d |_string:| ptr);..|
|00000c90| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 70 72 69 |This rou|tine pri|
|00000ca0| 6e 74 73 20 61 20 63 2d | 73 74 79 6c 65 2c 20 6e |nts a c-|style, n|
|00000cb0| 75 6c 6c 2d 74 65 72 6d | 69 6e 61 74 65 64 2c 20 |ull-term|inated, |
|00000cc0| 73 74 72 69 6e 67 20 74 | 6f 20 73 74 64 6f 75 74 |string t|o stdout|
|00000cd0| 2e 20 20 54 68 65 20 73 | 74 72 69 6e 67 20 62 75 |. The s|tring bu|
|00000ce0| 66 66 65 72 20 73 68 6f | 75 6c 64 20 62 65 20 64 |ffer sho|uld be d|
|00000cf0| 65 66 69 6e 65 64 20 61 | 73 3a 20 22 66 6f 6f 20 |efined a|s: "foo |
|00000d00| 3a 20 70 61 63 6b 65 64 | 20 61 72 72 61 79 5b 78 |: packed| array[x|
|00000d10| 2e 2e 79 5d 20 6f 66 20 | 63 68 61 72 22 2e 20 20 |..y] of |char". |
|00000d20| 54 68 65 20 63 61 6c 6c | 20 6d 61 79 20 74 68 65 |The call| may the|
|00000d30| 6e 20 62 65 20 6d 61 64 | 65 20 75 73 69 6e 67 20 |n be mad|e using |
|00000d40| 74 68 65 20 40 20 6f 70 | 65 72 61 74 6f 72 3a 20 |the @ op|erator: |
|00000d50| 22 4e 53 48 5f 70 75 74 | 73 28 20 6e 73 68 63 5f |"NSH_put|s( nshc_|
|00000d60| 63 61 6c 6c 73 2c 20 40 | 66 6f 6f 20 29 3b 0d 0d |calls, @|foo );..|
|00000d70| 4e 53 48 5f 70 75 74 53 | 74 72 0d 2d 2d 2d 2d 2d |NSH_putS|tr.-----|
|00000d80| 2d 2d 2d 2d 2d 0d 0d 70 | 72 6f 63 65 64 75 72 65 |-----..p|rocedure|
|00000d90| 20 4e 53 48 5f 70 75 74 | 53 74 72 20 28 6e 73 68 | NSH_put|Str (nsh|
|00000da0| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|00000db0| 63 61 6c 6c 73 3b 20 73 | 3a 20 53 74 72 32 35 35 |calls; s|: Str255|
|00000dc0| 29 3b 0d 0d 54 68 69 73 | 20 72 6f 75 74 69 6e 65 |);..This| routine|
|00000dd0| 20 70 72 69 6e 74 73 20 | 61 20 50 61 73 63 61 6c | prints |a Pascal|
|00000de0| 20 73 74 72 69 6e 67 20 | 74 6f 20 74 68 65 20 73 | string |to the s|
|00000df0| 74 64 6f 75 74 20 64 65 | 76 69 63 65 2e 0d 0d 69 |tdout de|vice...i|
|00000e00| 6e 70 75 74 20 66 72 6f | 6d 20 73 74 64 69 6e 0d |nput fro|m stdin.|
|00000e10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000e20| 0d 0d 4e 53 48 5f 67 65 | 74 63 68 61 72 0d 2d 2d |..NSH_ge|tchar.--|
|00000e30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 0d 66 75 6e 63 74 |--------|-..funct|
|00000e40| 69 6f 6e 20 4e 53 48 5f | 67 65 74 63 68 61 72 20 |ion NSH_|getchar |
|00000e50| 28 6e 73 68 63 5f 63 61 | 6c 6c 73 3a 20 74 5f 6e |(nshc_ca|lls: t_n|
|00000e60| 73 68 63 5f 63 61 6c 6c | 73 29 3a 20 69 6e 74 65 |shc_call|s): inte|
|00000e70| 67 65 72 3b 0d 0d 54 68 | 69 73 20 72 6f 75 74 69 |ger;..Th|is routi|
|00000e80| 6e 65 20 63 6f 6c 6c 65 | 63 74 73 20 61 20 73 69 |ne colle|cts a si|
|00000e90| 6e 67 6c 65 20 63 68 61 | 72 61 63 74 65 72 20 66 |ngle cha|racter f|
|00000ea0| 72 6f 6d 20 73 74 64 69 | 6e 2e 20 20 52 65 74 75 |rom stdi|n. Retu|
|00000eb0| 72 6e 73 3a 0d 0d 30 20 | 3d 20 4e 6f 20 63 68 61 |rns:..0 |= No cha|
|00000ec0| 72 61 63 74 65 72 20 61 | 76 61 69 6c 61 62 6c 65 |racter a|vailable|
|00000ed0| 0d 2d 31 20 3d 20 45 6e | 64 20 6f 66 20 69 6e 70 |.-1 = En|d of inp|
|00000ee0| 75 74 0d 6f 74 68 65 72 | 73 20 3d 20 4e 65 78 74 |ut.other|s = Next|
|00000ef0| 20 63 68 61 72 61 63 74 | 65 72 20 69 6e 20 71 75 | charact|er in qu|
|00000f00| 65 75 65 0d 0d 2a 2a 2a | 20 4e 4f 54 45 3a 20 20 |eue..***| NOTE: |
|00000f10| 41 6e 20 65 72 72 6f 72 | 20 69 6e 20 6e 53 68 65 |An error| in nShe|
|00000f20| 6c 6c 20 76 65 72 73 69 | 6f 6e 73 20 70 72 69 6f |ll versi|ons prio|
|00000f30| 72 20 74 6f 20 76 31 2e | 30 2e 32 20 63 61 75 73 |r to v1.|0.2 caus|
|00000f40| 65 64 20 61 20 5e 44 20 | 6b 65 79 20 74 6f 20 62 |ed a ^D |key to b|
|00000f50| 65 20 72 65 74 75 72 6e | 65 64 20 64 69 72 65 63 |e return|ed direc|
|00000f60| 74 6c 79 20 28 30 34 20 | 64 65 63 69 6d 61 6c 29 |tly (04 |decimal)|
|00000f70| 2c 20 61 6e 64 20 6e 6f | 74 20 74 6f 20 62 65 20 |, and no|t to be |
|00000f80| 63 6f 6e 76 65 72 74 65 | 64 20 74 6f 20 2d 31 2e |converte|d to -1.|
|00000f90| 20 2a 2a 2a 0d 0d 4e 53 | 48 5f 67 65 74 73 0d 2d | ***..NS|H_gets.-|
|00000fa0| 2d 2d 2d 2d 2d 2d 2d 0d | 0d 66 75 6e 63 74 69 6f |-------.|.functio|
|00000fb0| 6e 20 4e 53 48 5f 67 65 | 74 73 20 28 6e 73 68 63 |n NSH_ge|ts (nshc|
|00000fc0| 5f 63 61 6c 6c 73 3a 20 | 74 5f 6e 73 68 63 5f 63 |_calls: |t_nshc_c|
|00000fd0| 61 6c 6c 73 3b 20 63 5f | 73 74 72 69 6e 67 3a 20 |alls; c_|string: |
|00000fe0| 70 74 72 3b 20 73 69 7a | 65 3a 20 69 6e 74 65 67 |ptr; siz|e: integ|
|00000ff0| 65 72 29 3a 20 69 6e 74 | 65 67 65 72 3b 0d 0d 54 |er): int|eger;..T|
|00001000| 68 69 73 20 72 6f 75 74 | 69 6e 65 20 63 6f 6c 6c |his rout|ine coll|
|00001010| 65 63 74 73 20 61 20 63 | 2d 73 74 79 6c 65 20 73 |ects a c|-style s|
|00001020| 74 72 69 6e 67 20 66 72 | 6f 6d 20 73 74 64 69 6e |tring fr|om stdin|
|00001030| 2e 20 20 54 68 65 20 73 | 74 72 69 6e 67 20 62 75 |. The s|tring bu|
|00001040| 66 66 65 72 20 73 68 6f | 75 6c 64 20 62 65 20 64 |ffer sho|uld be d|
|00001050| 65 66 69 6e 65 64 20 61 | 73 3a 20 22 66 6f 6f 20 |efined a|s: "foo |
|00001060| 3a 20 70 61 63 6b 65 64 | 20 61 72 72 61 79 5b 78 |: packed| array[x|
|00001070| 2e 2e 79 5d 20 6f 66 20 | 63 68 61 72 22 2e 20 20 |..y] of |char". |
|00001080| 54 68 65 20 63 61 6c 6c | 20 6d 61 79 20 74 68 65 |The call| may the|
|00001090| 6e 20 62 65 20 6d 61 64 | 65 20 75 73 69 6e 67 20 |n be mad|e using |
|000010a0| 74 68 65 20 40 20 6f 70 | 65 72 61 74 6f 72 3a 20 |the @ op|erator: |
|000010b0| 22 4e 53 48 5f 67 65 74 | 73 28 20 6e 73 68 63 5f |"NSH_get|s( nshc_|
|000010c0| 63 61 6c 6c 73 2c 20 40 | 66 6f 6f 2c 20 73 69 7a |calls, @|foo, siz|
|000010d0| 65 20 29 3b 22 2e 20 54 | 68 65 20 22 73 69 7a 65 |e );". T|he "size|
|000010e0| 22 20 66 69 65 6c 64 20 | 64 65 66 69 6e 65 73 20 |" field |defines |
|000010f0| 74 68 65 20 6d 61 78 69 | 6d 75 6d 20 6c 65 6e 67 |the maxi|mum leng|
|00001100| 74 68 20 6f 66 20 74 68 | 65 20 69 6e 70 75 74 20 |th of th|e input |
|00001110| 73 74 72 69 6e 67 2e 20 | 20 52 65 74 75 72 6e 73 |string. | Returns|
|00001120| 3a 0d 0d 30 20 3d 20 4e | 6f 20 63 68 61 72 61 63 |:..0 = N|o charac|
|00001130| 74 65 72 20 61 76 61 69 | 6c 61 62 6c 65 0d 2d 31 |ter avai|lable.-1|
|00001140| 20 3d 20 45 6e 64 20 6f | 66 20 69 6e 70 75 74 0d | = End o|f input.|
|00001150| 6f 74 68 65 72 73 20 3d | 20 4c 65 6e 67 74 68 20 |others =| Length |
|00001160| 6f 66 20 69 6e 70 75 74 | 20 73 74 72 69 6e 67 0d |of input| string.|
|00001170| 0d 4e 53 48 5f 67 65 74 | 53 74 72 0d 2d 2d 2d 2d |.NSH_get|Str.----|
|00001180| 2d 2d 2d 2d 2d 2d 0d 0d | 66 75 6e 63 74 69 6f 6e |------..|function|
|00001190| 20 4e 53 48 5f 67 65 74 | 53 74 72 20 28 6e 73 68 | NSH_get|Str (nsh|
|000011a0| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|000011b0| 63 61 6c 6c 73 3b 20 73 | 3a 20 53 74 72 32 35 35 |calls; s|: Str255|
|000011c0| 29 3a 20 69 6e 74 65 67 | 65 72 3b 0d 0d 54 68 69 |): integ|er;..Thi|
|000011d0| 73 20 72 6f 75 74 69 6e | 65 20 63 6f 6c 6c 65 63 |s routin|e collec|
|000011e0| 74 73 20 61 20 32 35 35 | 20 63 68 61 72 61 63 74 |ts a 255| charact|
|000011f0| 65 72 20 50 61 73 63 61 | 6c 2d 73 74 79 6c 65 20 |er Pasca|l-style |
|00001200| 73 74 72 69 6e 67 20 66 | 72 6f 6d 20 73 74 64 69 |string f|rom stdi|
|00001210| 6e 2e 20 20 52 65 74 75 | 72 6e 73 3a 0d 0d 30 20 |n. Retu|rns:..0 |
|00001220| 3d 20 4e 6f 20 63 68 61 | 72 61 63 74 65 72 20 61 |= No cha|racter a|
|00001230| 76 61 69 6c 61 62 6c 65 | 0d 2d 31 20 3d 20 45 6e |vailable|.-1 = En|
|00001240| 64 20 6f 66 20 69 6e 70 | 75 74 0d 6f 74 68 65 72 |d of inp|ut.other|
|00001250| 73 20 3d 20 4c 65 6e 67 | 74 68 20 6f 66 20 69 6e |s = Leng|th of in|
|00001260| 70 75 74 20 73 74 72 69 | 6e 67 0d 0d 76 61 72 69 |put stri|ng..vari|
|00001270| 61 62 6c 65 20 61 63 63 | 65 73 73 20 66 75 6e 63 |able acc|ess func|
|00001280| 74 69 6f 6e 73 0d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |tions.==|========|
|00001290| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 0d |========|=======.|
|000012a0| 0d 4e 53 48 5f 76 61 72 | 5f 73 65 74 0d 2d 2d 2d |.NSH_var|_set.---|
|000012b0| 2d 2d 2d 2d 2d 2d 2d 2d | 0d 0d 66 75 6e 63 74 69 |--------|..functi|
|000012c0| 6f 6e 20 4e 53 48 5f 76 | 61 72 5f 73 65 74 20 28 |on NSH_v|ar_set (|
|000012d0| 6e 73 68 63 5f 63 61 6c | 6c 73 3a 20 74 5f 6e 73 |nshc_cal|ls: t_ns|
|000012e0| 68 63 5f 63 61 6c 6c 73 | 3b 20 6e 61 6d 65 3a 20 |hc_calls|; name: |
|000012f0| 53 74 72 33 32 3b 20 76 | 61 6c 75 65 3a 20 53 74 |Str32; v|alue: St|
|00001300| 72 32 35 35 29 3a 20 69 | 6e 74 65 67 65 72 3b 0d |r255): i|nteger;.|
|00001310| 0d 41 73 73 69 67 6e 73 | 20 74 68 65 20 22 76 61 |.Assigns| the "va|
|00001320| 6c 75 65 22 20 73 74 72 | 69 6e 67 20 74 6f 20 61 |lue" str|ing to a|
|00001330| 20 76 61 72 69 61 62 6c | 65 20 6f 66 20 74 68 65 | variabl|e of the|
|00001340| 20 67 69 76 65 6e 20 22 | 6e 61 6d 65 22 2e 20 20 | given "|name". |
|00001350| 49 66 20 61 20 6d 61 74 | 63 68 69 6e 67 20 76 61 |If a mat|ching va|
|00001360| 72 69 61 62 6c 65 20 69 | 73 20 6e 6f 74 20 66 6f |riable i|s not fo|
|00001370| 75 6e 64 2c 20 61 20 6e | 65 77 20 6f 6e 65 20 77 |und, a n|ew one w|
|00001380| 69 6c 6c 20 62 65 20 63 | 72 65 61 74 65 64 2e 20 |ill be c|reated. |
|00001390| 20 52 65 74 75 72 6e 73 | 3a 20 30 20 3d 20 73 75 | Returns|: 0 = su|
|000013a0| 63 63 65 73 73 2c 20 2d | 31 20 3d 20 63 6f 75 6c |ccess, -|1 = coul|
|000013b0| 64 20 6e 6f 74 20 63 72 | 65 61 74 65 20 76 61 72 |d not cr|eate var|
|000013c0| 69 61 62 6c 65 2e 0d 0d | 4e 53 48 5f 76 61 72 5f |iable...|NSH_var_|
|000013d0| 75 6e 73 65 74 0d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |unset.--|--------|
|000013e0| 2d 2d 2d 0d 0d 66 75 6e | 63 74 69 6f 6e 20 4e 53 |---..fun|ction NS|
|000013f0| 48 5f 76 61 72 5f 75 6e | 73 65 74 20 28 6e 73 68 |H_var_un|set (nsh|
|00001400| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|00001410| 63 61 6c 6c 73 3b 20 6e | 61 6d 65 3a 20 53 74 72 |calls; n|ame: Str|
|00001420| 33 32 29 3a 20 69 6e 74 | 65 67 65 72 3b 0d 0d 52 |32): int|eger;..R|
|00001430| 65 6d 6f 76 65 73 20 74 | 68 65 20 76 61 72 69 61 |emoves t|he varia|
|00001440| 62 6c 65 20 6f 66 20 74 | 68 65 20 67 69 76 65 6e |ble of t|he given|
|00001450| 20 22 6e 61 6d 65 22 2e | 20 20 52 65 74 75 72 6e | "name".| Return|
|00001460| 73 3a 20 30 20 3d 20 66 | 6f 75 6e 64 20 61 6e 64 |s: 0 = f|ound and|
|00001470| 20 63 6c 65 61 72 65 64 | 2c 20 31 20 3d 20 63 6f | cleared|, 1 = co|
|00001480| 75 6c 64 20 66 69 6e 64 | 20 63 72 65 61 74 65 20 |uld find| create |
|00001490| 76 61 72 69 61 62 6c 65 | 2e 0d 0d 4e 53 48 5f 76 |variable|...NSH_v|
|000014a0| 61 72 5f 65 6e 76 0d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ar_env.-|--------|
|000014b0| 2d 2d 0d 0d 66 75 6e 63 | 74 69 6f 6e 20 4e 53 48 |--..func|tion NSH|
|000014c0| 5f 76 61 72 5f 65 6e 76 | 20 28 6e 73 68 63 5f 63 |_var_env| (nshc_c|
|000014d0| 61 6c 6c 73 3a 20 74 5f | 6e 73 68 63 5f 63 61 6c |alls: t_|nshc_cal|
|000014e0| 6c 73 3b 20 6e 61 6d 65 | 3a 20 53 74 72 33 32 3b |ls; name|: Str32;|
|000014f0| 20 76 61 6c 75 65 3a 20 | 53 74 72 32 35 35 29 3a | value: |Str255):|
|00001500| 20 69 6e 74 65 67 65 72 | 3b 0d 0d 53 65 61 72 63 | integer|;..Searc|
|00001510| 68 65 73 20 66 6f 72 20 | 61 20 76 61 72 69 61 62 |hes for |a variab|
|00001520| 6c 65 20 6f 66 20 74 68 | 65 20 67 69 76 65 6e 20 |le of th|e given |
|00001530| 22 6e 61 6d 65 22 2c 20 | 61 6e 64 20 72 65 74 75 |"name", |and retu|
|00001540| 72 6e 73 20 69 74 73 20 | 22 76 61 6c 75 65 22 2e |rns its |"value".|
|00001550| 20 20 52 65 74 75 72 6e | 73 3a 20 30 20 3d 20 73 | Return|s: 0 = s|
|00001560| 75 63 63 65 73 73 2c 20 | 31 20 3d 20 63 6f 75 6c |uccess, |1 = coul|
|00001570| 64 20 66 69 6e 64 20 63 | 72 65 61 74 65 20 76 61 |d find c|reate va|
|00001580| 72 69 61 62 6c 65 2e 0d | 0d 70 61 74 68 20 65 78 |riable..|.path ex|
|00001590| 70 61 6e 73 69 6f 6e 20 | 66 75 6e 63 74 69 6f 6e |pansion |function|
|000015a0| 73 0d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |s.======|========|
|000015b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 0d 4e 53 48 5f |========|==..NSH_|
|000015c0| 70 61 74 68 5f 65 78 70 | 61 6e 64 0d 2d 2d 2d 2d |path_exp|and.----|
|000015d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 0d 66 75 6e |--------|---..fun|
|000015e0| 63 74 69 6f 6e 20 4e 53 | 48 5f 70 61 74 68 5f 65 |ction NS|H_path_e|
|000015f0| 78 70 61 6e 64 20 28 6e | 73 68 63 5f 63 61 6c 6c |xpand (n|shc_call|
|00001600| 73 3a 20 74 5f 6e 73 68 | 63 5f 63 61 6c 6c 73 3b |s: t_nsh|c_calls;|
|00001610| 20 70 61 74 68 3a 20 53 | 74 72 32 35 35 29 3a 20 | path: S|tr255): |
|00001620| 69 6e 74 65 67 65 72 3b | 0d 0d 45 78 70 61 6e 64 |integer;|..Expand|
|00001630| 73 20 61 20 66 75 6c 6c | 20 6f 72 20 70 61 72 74 |s a full| or part|
|00001640| 69 61 6c 20 22 70 61 74 | 68 22 20 69 6e 20 70 6c |ial "pat|h" in pl|
|00001650| 61 63 65 2e 20 52 65 74 | 75 72 6e 73 3a 20 30 20 |ace. Ret|urns: 0 |
|00001660| 3d 20 73 75 63 63 65 73 | 73 20 6f 72 20 31 20 3d |= succes|s or 1 =|
|00001670| 20 66 61 69 6c 75 72 65 | 2e 0d 0d 4e 53 48 5f 70 | failure|...NSH_p|
|00001680| 61 74 68 5f 74 6f 5f 46 | 53 53 70 65 63 0d 2d 2d |ath_to_F|SSpec.--|
|00001690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016a0| 0d 0d 66 75 6e 63 74 69 | 6f 6e 20 4e 53 48 5f 70 |..functi|on NSH_p|
|000016b0| 61 74 68 5f 74 6f 5f 46 | 53 53 70 65 63 28 20 6e |ath_to_F|SSpec( n|
|000016c0| 73 68 63 5f 63 61 6c 6c | 73 3a 20 74 5f 6e 73 68 |shc_call|s: t_nsh|
|000016d0| 63 5f 63 61 6c 6c 73 3b | 20 70 61 74 68 3a 20 53 |c_calls;| path: S|
|000016e0| 74 72 32 35 35 3b 20 73 | 70 65 63 3a 20 46 53 53 |tr255; s|pec: FSS|
|000016f0| 70 65 63 50 74 72 29 3a | 20 69 6e 74 65 67 65 72 |pecPtr):| integer|
|00001700| 3b 0d 0d 45 78 70 61 6e | 64 73 20 61 20 66 75 6c |;..Expan|ds a ful|
|00001710| 6c 20 6f 72 20 70 61 72 | 74 69 61 6c 20 22 70 61 |l or par|tial "pa|
|00001720| 74 68 22 20 69 6e 20 70 | 6c 61 63 65 2e 20 52 65 |th" in p|lace. Re|
|00001730| 74 75 72 6e 73 3a 20 30 | 20 3d 20 73 75 63 63 65 |turns: 0| = succe|
|00001740| 73 73 20 6f 72 20 31 20 | 3d 20 66 61 69 6c 75 72 |ss or 1 |= failur|
|00001750| 65 2e 0d 0d 4e 53 48 5f | 70 61 74 68 5f 77 68 69 |e...NSH_|path_whi|
|00001760| 63 68 0d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ch.-----|--------|
|00001770| 2d 0d 0d 66 75 6e 63 74 | 69 6f 6e 20 4e 53 48 5f |-..funct|ion NSH_|
|00001780| 70 61 74 68 5f 77 68 69 | 63 68 20 28 6e 73 68 63 |path_whi|ch (nshc|
|00001790| 5f 63 61 6c 6c 73 3a 20 | 74 5f 6e 73 68 63 5f 63 |_calls: |t_nshc_c|
|000017a0| 61 6c 6c 73 3b 20 63 6d | 64 5f 70 61 74 68 3a 20 |alls; cm|d_path: |
|000017b0| 53 74 72 32 35 35 29 3a | 20 69 6e 74 65 67 65 72 |Str255):| integer|
|000017c0| 3b 0d 0d 46 6f 6c 6c 6f | 77 73 20 74 68 65 20 63 |;..Follo|ws the c|
|000017d0| 6f 6d 6d 61 6e 64 20 73 | 65 61 72 63 68 20 70 61 |ommand s|earch pa|
|000017e0| 74 68 2c 20 61 6e 64 20 | 65 78 70 61 6e 64 73 20 |th, and |expands |
|000017f0| 61 20 66 75 6c 6c 20 6f | 72 20 70 61 72 74 69 61 |a full o|r partia|
|00001800| 6c 20 22 63 6d 64 5f 70 | 61 74 68 22 20 69 6e 20 |l "cmd_p|ath" in |
|00001810| 70 6c 61 63 65 2e 20 52 | 65 74 75 72 6e 73 3a 20 |place. R|eturns: |
|00001820| 30 20 3d 20 73 75 63 63 | 65 73 73 20 6f 72 20 31 |0 = succ|ess or 1|
|00001830| 20 3d 20 66 61 69 6c 75 | 72 65 2e 0d 0d 64 69 61 | = failu|re...dia|
|00001840| 6c 6f 67 20 66 75 6e 63 | 74 69 6f 6e 73 0d 3d 3d |log func|tions.==|
|00001850| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 0d |========|======..|
|00001860| 4e 53 48 5f 6e 6f 74 69 | 66 79 0d 2d 2d 2d 2d 2d |NSH_noti|fy.-----|
|00001870| 2d 2d 2d 2d 2d 0d 0d 70 | 72 6f 63 65 64 75 72 65 |-----..p|rocedure|
|00001880| 20 4e 53 48 5f 6e 6f 74 | 69 66 79 20 28 6e 73 68 | NSH_not|ify (nsh|
|00001890| 63 5f 63 61 6c 6c 73 3a | 20 74 5f 6e 73 68 63 5f |c_calls:| t_nshc_|
|000018a0| 63 61 6c 6c 73 3b 20 73 | 3a 20 53 74 72 32 35 35 |calls; s|: Str255|
|000018b0| 3b 20 73 69 7a 65 3a 20 | 69 6e 74 65 67 65 72 29 |; size: |integer)|
|000018c0| 3b 0d 0d 50 6f 70 20 61 | 20 6d 6f 64 61 6c 20 64 |;..Pop a| modal d|
|000018d0| 69 61 6c 6f 67 20 63 6f | 6e 74 61 69 6e 69 6e 67 |ialog co|ntaining|
|000018e0| 20 74 68 65 20 67 69 76 | 65 6e 20 73 74 72 69 6e | the giv|en strin|
|000018f0| 67 2e 20 20 54 68 65 20 | 64 69 61 6c 6f 67 20 6d |g. The |dialog m|
|00001900| 61 79 20 62 65 20 67 69 | 76 65 6e 20 6f 6e 65 20 |ay be gi|ven one |
|00001910| 6f 66 20 74 68 72 65 65 | 20 73 69 7a 65 73 3a 20 |of three| sizes: |
|00001920| 30 20 3d 20 73 6d 61 6c | 6c 2c 20 31 20 3d 20 6d |0 = smal|l, 1 = m|
|00001930| 65 64 69 75 6d 2c 20 32 | 20 3d 20 6c 61 72 67 65 |edium, 2| = large|
|00001940| 2e 0d 0d 4e 53 48 5f 61 | 73 6b 0d 2d 2d 2d 2d 2d |...NSH_a|sk.-----|
|00001950| 2d 2d 0d 0d 66 75 6e 63 | 74 69 6f 6e 20 4e 53 48 |--..func|tion NSH|
|00001960| 5f 61 73 6b 20 28 6e 73 | 68 63 5f 63 61 6c 6c 73 |_ask (ns|hc_calls|
|00001970| 3a 20 74 5f 6e 73 68 63 | 5f 63 61 6c 6c 73 3b 20 |: t_nshc|_calls; |
|00001980| 73 3a 20 53 74 72 32 35 | 35 3b 20 73 69 7a 65 3a |s: Str25|5; size:|
|00001990| 20 69 6e 74 65 67 65 72 | 29 3a 20 69 6e 74 65 67 | integer|): integ|
|000019a0| 65 72 3b 0d 0d 50 6f 70 | 20 61 20 74 68 72 65 65 |er;..Pop| a three|
|000019b0| 20 62 75 74 74 6f 6e 20 | 6d 6f 64 61 6c 20 64 69 | button |modal di|
|000019c0| 61 6c 6f 67 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |alog con|taining |
|000019d0| 74 68 65 20 67 69 76 65 | 6e 20 73 74 72 69 6e 67 |the give|n string|
|000019e0| 2e 20 20 54 68 65 20 74 | 68 72 65 65 20 62 75 74 |. The t|hree but|
|000019f0| 74 6f 6e 73 20 61 72 65 | 20 22 59 65 73 22 2c 20 |tons are| "Yes", |
|00001a00| 22 4e 6f 22 2c 20 61 6e | 64 20 22 43 61 6e 63 65 |"No", an|d "Cance|
|00001a10| 6c 22 2e 20 20 54 68 65 | 20 64 69 61 6c 6f 67 20 |l". The| dialog |
|00001a20| 6d 61 79 20 62 65 20 67 | 69 76 65 6e 20 6f 6e 65 |may be g|iven one|
|00001a30| 20 6f 66 20 74 68 72 65 | 65 20 73 69 7a 65 73 3a | of thre|e sizes:|
|00001a40| 20 30 20 3d 20 73 6d 61 | 6c 6c 2c 20 31 20 3d 20 | 0 = sma|ll, 1 = |
|00001a50| 6d 65 64 69 75 6d 2c 20 | 32 20 3d 20 6c 61 72 67 |medium, |2 = larg|
|00001a60| 65 2e 20 20 52 65 74 75 | 72 6e 73 3a 20 31 20 3d |e. Retu|rns: 1 =|
|00001a70| 20 79 65 73 2c 20 32 20 | 3d 20 6e 6f 2c 20 33 20 | yes, 2 |= no, 3 |
|00001a80| 3d 20 63 61 6e 63 65 6c | 2e 0d 0d 6d 69 73 63 0d |= cancel|...misc.|
|00001a90| 3d 3d 3d 3d 0d 0d 4e 53 | 48 5f 6d 61 74 63 68 0d |====..NS|H_match.|
|00001aa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 0d 66 75 6e 63 74 |--------|-..funct|
|00001ab0| 69 6f 6e 20 4e 53 48 5f | 6d 61 74 63 68 20 28 6e |ion NSH_|match (n|
|00001ac0| 73 68 63 5f 63 61 6c 6c | 73 3a 20 74 5f 6e 73 68 |shc_call|s: t_nsh|
|00001ad0| 63 5f 63 61 6c 6c 73 3b | 20 70 61 74 74 65 72 6e |c_calls;| pattern|
|00001ae0| 3a 20 53 74 72 32 35 35 | 3b 20 74 61 72 67 65 74 |: Str255|; target|
|00001af0| 3a 20 53 74 72 32 35 35 | 29 3a 20 69 6e 74 65 67 |: Str255|): integ|
|00001b00| 65 72 3b 0d 0d 54 68 65 | 20 67 69 76 65 6e 20 22 |er;..The| given "|
|00001b10| 70 61 74 74 65 72 6e 22 | 20 69 73 20 63 6f 6d 70 |pattern"| is comp|
|00001b20| 61 72 65 64 20 61 67 61 | 69 6e 73 74 20 74 68 65 |ared aga|inst the|
|00001b30| 20 22 74 61 72 67 65 74 | 22 20 61 63 63 6f 72 64 | "target|" accord|
|00001b40| 69 6e 67 20 74 6f 20 73 | 68 65 6c 6c 20 77 69 6c |ing to s|hell wil|
|00001b50| 64 63 61 72 64 20 72 75 | 6c 65 73 2e 20 52 65 74 |dcard ru|les. Ret|
|00001b60| 75 72 6e 73 3a 20 30 20 | 3d 20 6d 61 74 63 68 2c |urns: 0 |= match,|
|00001b70| 20 31 20 3d 20 6e 6f 20 | 6d 61 74 63 68 2e 0d 0d | 1 = no |match...|
|00001b80| 00 00 01 00 00 00 01 1a | 00 00 00 1a 00 00 00 32 |........|.......2|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bb0| 13 54 4e 20 32 20 2d 20 | 54 68 69 6e 6b 20 50 61 |.TN 2 - |Think Pa|
|00001bc0| 73 63 61 6c 02 00 00 00 | 50 61 72 74 53 49 54 21 |scal....|PartSIT!|
|00001bd0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 ab 2c 65 c6 00 00 | 00 00 00 00 01 4c 00 00 |...,e...|.....L..|
|00001c00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c80| 00 00 00 16 00 01 00 00 | 00 00 00 0c 00 0a 00 16 |........|........|
|00001c90| 00 00 00 0c 00 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|00001ca0| 01 1a 00 00 00 1a 00 00 | 00 32 00 57 7c cc 0b c2 |........|.2.W|...|
|00001cb0| 00 00 00 1c 00 32 00 00 | 73 74 79 6c 00 00 00 0a |.....2..|styl....|
|00001cc0| 00 80 ff ff 00 00 00 00 | 00 57 d9 04 00 00 00 00 |........|.W......|
|00001cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+